All Questions
Tagged with javaunit-testing
195 questions
1vote
2answers
105views
simple Text Table utility
A small utility to print data in an ascii table TextTable ...
2votes
1answer
583views
Basic Ticket booking code with Unit tests
I am going to run a session for a few other developers who are new to Junit, mocking, etc. I have designed a very simple application with classes and tests to demonstrate how to do unit testing. ...
0votes
1answer
100views
First time writing tests (Service Layer)
Service class: ...
1vote
1answer
95views
A simple Java integer integer hash set - follow-up 2
(See the previous version.) Now I have this: com.github.coderodde.util.IntHashSet: ...
6votes
4answers
1kviews
A simple Java integer hash set
(See the next version.) The following data structure implements a hash table based set for int values: ...
5votes
2answers
506views
Hungarian algorithm for optimal assignment
The assignment problem is about assigning tasks to workers, where each pair (worker, task) has a cost. The Hungarian algorithm builds an optimal solution for this problem. It has two variants, ...
0votes
1answer
58views
Faster, indexed, heuristic doubly-linked list data structure in Java: unit tests
Here I have the unit tests for the indexed doubly-linked list. It goes like this: ...
3votes
1answer
1kviews
Testing DAO Delete User
I have several Dao classes, including a UserDao, below. The DAOs have many methods, but I'm focussing on deleteUser: ...
0votes
1answer
423views
Unit tests for User class with JUnit 5
This is a follow-up question for Android app class serialization. Some problems have been mentioned in forsvarir's answer. Then, I am following JUnit 5 User Guide to redesign the test cases for ...
2votes
1answer
100views
Android app class serialization
I am attempting to build an Android APP with the custom serializable class User. The public method Save is to save class ...
0votes
2answers
1kviews
Need Feedback on JUnit test comparing two timestamps
I am writng a JUnit test case for the below methods : ...
3votes
2answers
306views
Replace words from a file with words from a dictionary based file
I'm working on a coding challenge that tasks me with taking a file with a dictionary, reading from it, and then replacing the matching words from the input file with what is found in the dictionary. I ...
1vote
1answer
92views
What to test on a rest API?
I created a rest controller with Spring Boot, I am trying to learn what I should write on my tests, right now I only check status codes and keys existence. I am planning to build an API to showcase at ...
1vote
1answer
175views
Binary Search recursive & iterative solution
I have implemented binary search solution by using recursion and iterative approach. I there any way to improve it? Tests ...
4votes
2answers
244views
Sanity check a simple RPG character
I'm writing an assistant for the tabletop RPG Pathfinder in Java. I intend to use the MVVM pattern using JavaFX, possibly through mvvmFX. Before I go into the V-VM phase, I have built a first ...